import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '候选人',
    align: "center",
    sorter: true,
    dataIndex: 'candidate'
  },
  {
    title: '应聘职位',
    align: "center",
    sorter: true,
    dataIndex: 'positionApplied'
  },
  {
    title: '面试日期',
    align: "center",
    sorter: true,
    dataIndex: 'interviewDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text);
    },
  },
  {
    title: '时间',
    align: "center",
    sorter: true,
    dataIndex: 'interviewTime'
  },
  {
    title: '面试阶段',
    align: "center",
    sorter: true,
    dataIndex: 'interviewStage'
  },
  {
    title: '面试负责人',
    align: "center",
    sorter: true,
    dataIndex: 'interviewManager'
  },
  {
    title: '候选人状态',
    align: "center",
    sorter: true,
    dataIndex: 'candidateStatus'
  },
  {
    title: '面试官',
    align: "center",
    sorter: true,
    dataIndex: 'interview'
  },
  {
    title: '反馈结果',
    align: "center",
    sorter: true,
  },
  // {
  //   title: '创建人',
  //   align: "center",
  //   sorter: true,
  //   dataIndex: 'createBy'
  // },
  // {
  //   title: '创建日期',
  //   align: "center",
  //   sorter: true,
  //   dataIndex: 'createTime'
  // },
  // {
  //   title: '更新人',
  //   align: "center",
  //   sorter: true,
  //   dataIndex: 'updateBy'
  // },
  // {
  //   title: '更新日期',
  //   align: "center",
  //   sorter: true,
  //   dataIndex: 'updateTime'
  // },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "候选人",
    field: 'candidate',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "应聘职位",
    field: 'positionApplied',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "面试日期",
    field: 'interviewDate',
    component: 'DatePicker',
    //colProps: {span: 6},
  },
  {
    label: "时间",
    field: 'interviewTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
  {
    label: "面试阶段",
    field: 'interviewStage',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "面试负责人",
    field: 'interviewManager',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "修选人状态",
    field: 'candidateStatus',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "面试官",
    field: 'interview',
    component: 'Input',
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '候选人',
    field: 'candidate',
    component: 'Input',
  },
  {
    label: '应聘职位',
    field: 'positionApplied',
    component: 'Input',
  },
  {
    label: '面试日期',
    field: 'interviewDate',
    component: 'DatePicker',
  },
  {
    label: '时间',
    field: 'interviewTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '面试阶段',
    field: 'interviewStage',
    component: 'Input',
  },
  {
    label: '面试负责人',
    field: 'interviewManager',
    component: 'Input',
  },
  {
    label: '修选人状态',
    field: 'candidateStatus',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  candidate: {title: '候选人',order: 0,view: 'text', type: 'string',},
  positionApplied: {title: '应聘职位',order: 1,view: 'text', type: 'string',},
  interviewDate: {title: '面试日期',order: 2,view: 'date', type: 'string',},
  interviewTime: {title: '时间',order: 3,view: 'datetime', type: 'string',},
  interviewStage: {title: '面试阶段',order: 4,view: 'text', type: 'string',},
  interviewManager: {title: '面试负责人',order: 5,view: 'text', type: 'string',},
  candidateStatus: {title: '修选人状态',order: 6,view: 'text', type: 'string',},
  interview: {title: '面试官',order: 7,view: 'text', type: 'string',},
  createBy: {title: '创建人',order: 8,view: 'text', type: 'string',},
  createTime: {title: '创建日期',order: 9,view: 'datetime', type: 'string',},
  updateBy: {title: '更新人',order: 10,view: 'text', type: 'string',},
  updateTime: {title: '更新日期',order: 11,view: 'datetime', type: 'string',},
};
